Getting Started with RFID by Tom Igoe
Author:Tom Igoe [Tom Igoe]
Language: eng
Format: epub, pdf
Tags: COMPUTERS / Data Transmission Systems / Wireless
ISBN: 9781449324131
Publisher: O'Reilly Media
Published: 2012-03-08T16:00:00+00:00
Try It
This sketch reads in bytes similar to the Processing sketches shown in Chapter 2. Upload it to your Arduino, launch the Arduino Serial Monitor (Tools→Serial Monitor), and make sure the Serial Monitor is configured for 9600 bps. Next, bring an RFID tag within range of the reader, and you should see the tag ID appear in the Serial Monitor window.
/* RFID Reader */ #include <SoftwareSerial.h> // Bring in the software serial library const int tagLength = 10; // each tag ID contains 10 bytes const int startByte = 0x0A; // Indicates start of a tag const int endByte = 0x0D; // Indicates end of a tag char tagID[tagLength + 1]; // array to hold the tag you read const int rxpin = 6; // Pin for receiving data from the RFID reader const int txpin = 7; // Transmit pin; not used SoftwareSerial rfidPort(rxpin, txpin); // create a Software Serial port void setup() { // begin serial communication with the computer Serial.begin(9600); // begin serial communication with the RFID module rfidPort.begin(2400); } void loop() { // read in and parse serial data: if (rfidPort.available() > 0) { // if (readTag()) { // Serial.println(tagID); } } } /* This method reads the tag, and puts its ID in the tagID */ boolean readTag() { char thisChar = rfidPort.read(); // if (thisChar == startByte) { // if (rfidPort.readBytesUntil(endByte, tagID, tagLength)) { // return true; } } return false; }
Here’s how the code works:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(21601)
Hello! Python by Anthony Briggs(20835)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(19293)
Dependency Injection in .NET by Mark Seemann(18895)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(18510)
Kotlin in Action by Dmitry Jemerov(18288)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(18119)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(16978)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(16947)
Grails in Action by Glen Smith Peter Ledbrook(16104)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(13799)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(11805)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(10636)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10590)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(9732)
Hit Refresh by Satya Nadella(9099)
The Kubernetes Operator Framework Book by Michael Dame(8534)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8358)
Robo-Advisor with Python by Aki Ranin(8302)